A face recognition technology generally includes two steps. First, features of a target face image are extracted. Second, a similarity is calculated between the extracted features and features in a reference face image.
Before calculating the similarity, a terminal first needs to calculate a face model matrix according to face images in a face image library, and then calculates the similarity between the extracted features and the features in the reference face image according to the calculated face model matrix. Conventionally, a terminal needs to perform calculation on all face images in a face image library, and obtains, through training according to calculation results, a face model matrix.